package cn.mw.cmdb.param.zabbixResult;

import cn.mw.microMonitorCommon.util.DateUtils;
import com.google.common.base.Strings;
import lombok.Data;

import java.util.Date;

import static cn.mw.cmdb.util.ValConvertUtil.longValueConvert;

@Data
public class MwZabbixItemResultParam {
    private Object lastvalue;
    private String hostid;
    private String itemid;
    private String name;
    private String units;
    private String value_type;
    private String lastclock;
    private Integer monitorServerId;
    private String valuemapid;
    private String delay;

    public String getDateConvert() {
        String formatDateTime = "";
        if (!Strings.isNullOrEmpty(lastclock)) {
            formatDateTime = DateUtils.formatDateTime(new Date(longValueConvert(lastclock) * 1000));
        }
        return formatDateTime;
    }

}
